#ifndef OPCODE_H
#define OPCODE_H

#include <stdio.h>
#include <string.h>

#define HLT   0
#define NEG   1
#define ADD   2
#define SUB   3
#define MUL   4
#define DIV   5
#define MOD   6
#define AND   7
#define OR    8
#define XOR   9
#define NOT  10
#define SLL  11
#define SRL  12
#define SLA  13
#define SRA  14
#define LT   15
#define GT   16
#define EQ   17
#define NE   18
#define LE   19
#define GE   20
#define J    21
#define LD   22
#define ST   23
#define RD   24
#define WR   25
#define ABS  26
#define EXT  27
#define LDHI 28
#define STHI 29
#define CALL 30

#define JI   J    | 0x20
#define STI  ST   | 0x20
#define LDI  LD   | 0x20
#define ADDI ADD  | 0x20
#define SUBI SUB  | 0X20
#define MULI MUL  | 0x20
#define DIVI DIV  | 0x20
#define MODI MOD  | 0x20
#define ANDI AND  | 0x20
#define ORI  OR   | 0x20
#define XORI XOR  | 0x20
#define SLLI SLL  | 0x20
#define SRLI SRL  | 0x20
#define SLAI SLA  | 0x20
#define SRAI SRA  | 0x20
#define LTI  LT   | 0x20
#define GTI  GT   | 0x20
#define EQI  EQ   | 0x20
#define NEI  NE   | 0x20
#define LEI  LE   | 0x20
#define GEI  GE   | 0x20
#define CALI CALL | 0X20

int lookup_opcode (char *code);

#endif

